Page({
  data: {
    winHeight: 0,
    coverHeight: '88rpx',
    markers: [],
  },
  onLoad() {
    this.initMapInfo();
    wx.getSystemInfo({
      success: res => {
        this.setData({
          winHeight: res.windowHeight,
        });
      },
    });
  },
  initMapInfo() {
    let { address, lat: latitude, lng: longitude } = this.options;
    this.setData({
      markers: [{
        iconPath: '/cm_video_alarm/Resources/location.png',
        id: 0,
        latitude,
        longitude,
      }],
      address,
      latitude,
      longitude,
    });
  },
  setHeight: function() {
    this.data.coverHeight === 'auto' ? this.setData({
      coverHeight: '88rpx',
    }) : this.setData({
      coverHeight: 'auto',
    });
  },
});
